/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Sistema;

/**
 * Created on : May 25, 2011, 9:51:23 PM
 * @author diogo
 */
public final class MenuEsquerdo {

	public String pagina;
	public String nome;
	public static final int FontSize = 18;
	public boolean acessoAdmin = true;
	public boolean acessoCliente = true;
	public boolean acessoProfissional = true;

	public MenuEsquerdo(String pagina, String nome) {
		this.pagina = pagina;
		this.nome = nome;
	}

	public MenuEsquerdo(String pagina, String nome, boolean acessoAdmin, boolean acessoCliente, boolean acessoProfissional) {
		this.pagina = pagina;
		this.nome = nome;
		this.acessoAdmin = acessoAdmin;
		this.acessoCliente = acessoCliente;
		this.acessoProfissional = acessoProfissional;
	}


	public static String Gerar(MenuEsquerdo menu, boolean ativo){
		/*
		<!-- "Home" button -->
		<script type="text/javascript">
		AC_FL_RunContent( 'codebase','http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0','width','250','height','30','src','flash/item','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','flash/item','flashvars','xml_filename=menu.xml&item_text=Home&item_link=index.htm&item_text_size=20&item_ajust=1&item_selected=1' ); //end AC code
		</script>
		 */
		StringBuilder result = new StringBuilder("");

		result.append(String.format("<!-- \"%s\" button -->", menu.nome));
		result.append("<script type=\"text/javascript\">");

		result.append(String.format("AC_FL_RunContent( 'codebase','http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0','width','250','height','30','src','flash/item','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','flash/item','flashvars','xml_filename=menu.xml&item_text=%s&item_link=%s&item_text_size=" + FontSize + "&item_ajust=%d&item_selected=%d' ); //end AC code", menu.nome, menu.pagina, (ativo ? 1 : 35), (ativo ? 1 : 0)));

		result.append("</script>");


		return result.toString();
	}
	
}
